/*
 * 首页入口模块
 * 2015-06-27 14:00
 * */
define(function(require,exports,module){
	/*通过 require 引入依赖*/
	require('jquery');
	var Banner = require('js/modules/banner.js');
	var twoTabs = require('js/modules/twoTabs.js');
	
	  
	$(function(){
		//调用banner组件
		 var indexBan = new Banner().init({
		 	id:'#drHomeBan',
		 	btnListId:'#drHomeBanxd',
		 	btnListClass:'drbanner_click',
            nextBtn:'#drbanNext',
            prevBtn:'#drbanPrev'
		 });		 
		//店铺banner
		$('.drstore-shopul').each(function(index){
			new Banner().init({
				id: $(this),
				btnListId:$(this).next('.drshop_xdcort').find('ul.drbanner_xd'),
				btnListClass:'drbanner_click'
			});		 
		});
		//店铺区域切换效果
		var shopTabs = new twoTabs().init({
			id:'#drstore-tab',
			firstWidth:128,
			otherWidth:140,
			timer: 500
		});
		//显示店铺地址
		$('.drstore-tittle img').off('click').on('click',function(){
			
			showIndexMap();
		});
		//关闭店铺地址
		$('.drshopMapInfo-close').off('click').on('click',function(){
			$('.dr_blackwall').hide();
			$('.drshopMap').stop(false,false).fadeOut();
		});			
		//点击地图店铺分页
		$('.drstore-mapInfo-pager a').off('click').on('click',function(){
			$('.drstore-mapInfo-pager a').removeClass('activate');
			$(this).addClass('activate');
            $('.drstore-shopList .drstore-shopDesc').hide().eq($(this).index()).show();
		});
		//点击地图省份
		$('.drstore-map a.hasShop').off('click').on('click',function(){
			$('.drstore-map a.hasShop').removeClass('activate');
			$(this).addClass('activate');
			
		});
		
		//点击全国一览显示地图
		$('#drMapLook').off('click').on('click',function(){
			$('#drMapShow').show();
			$('.drstore-tabin').hide();
		});
		// 点击城市执行以下代码
		// $('#drMapShow').hide();
		// $('.drstore-tabin').show();
		
		//首页后台程序js代码处
		
	});
	function showIndexMap(){
		$('.dr_blackwall').show();
		$('.drshopMap').stop(false,false).fadeIn();
	}
});
//定时消失
function indexwronghide() {
    $('#dr_sfwrong').hide();
    $("#dr_sfwrong").html("<p>Darry Ring严格规定男士凭证件一生仅能定制一枚，象征男人一生真爱的承诺。输入证件号码即可查询购买记录。</p>");
    $("#dr_sfwrong").addClass("index_yz-word");
    $("#dr_sfwrong").removeClass("drmember_yz-wrong");
}


